package main
import (
	"fmt"
)

type Student struct {
	Name string
	Age int
	Score int
}
func (stu *Student) setScore(score int) {
	stu.Score = score
}

type PrimarySchoolStudent struct {
	Student
}
func (p *PrimarySchoolStudent) testing() {
	fmt.Println("小学生正在考试。。。")
}

type CollegeStudent struct {
	Student
}
func (c *CollegeStudent) testing() {
	fmt.Println("大学生正在考试。。。")
}

func main() {
	var p1 = &PrimarySchoolStudent{}
	p1.Student.Name = "tom"
	p1.Student.Age = 8
	p1.testing()
	p1.setScore(90)
	fmt.Println(p1)

	var c1 = &CollegeStudent{}
	c1.Student.Name = "jack"
	c1.Student.Age = 20
	c1.testing()
	c1.setScore(85)
	fmt.Println(c1)
}